﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="OutputComments.ascx.cs" Inherits="SocialFront.Web.usercontrols.Shared.OutputComments" %>

<asp:ListView ID="lvHolder" runat="server" OnPagePropertiesChanging="lvHolder_PagePropertiesChanging">

    <LayoutTemplate>
    <article>
        <dl>
            <asp:PlaceHolder ID="itemPlaceholder" runat="server" />
        </dl>
    </article>
    </LayoutTemplate>

    <ItemTemplate>
        <dt>
          <h3>
            <%# ((SocialFront.Entities.Comment)Container.DataItem).Title %>
          </h3>
        </dt>
        <dd>
          <%# ((SocialFront.Entities.Comment)Container.DataItem).Content %>

          <time>
            <p><%# ((SocialFront.Entities.Comment)Container.DataItem).CreatedDate.ToString("hh:mm dd/MM/yy") %></p>
          </time>
          <member>
            <p><a href="<%# ((SocialFront.Entities.Comment)Container.DataItem).Member.MemberUrl %>"><%# ((SocialFront.Entities.Comment)Container.DataItem).Member.LoginName %></a></p>
          </member>
        </dd>   
    </ItemTemplate>
    
    <EmptyDataTemplate>
        <p>No comments have been added yet</p>
    </EmptyDataTemplate>

</asp:ListView>

<asp:DataPager runat="server" ID="ItemDataPager" PageSize="5" PagedControlID="lvHolder" QueryStringField="p">
    <Fields>
      <asp:NumericPagerField />
    </Fields>
</asp:DataPager>